#include "DAEMatrixArray.h"

DAEMatrixArray::DAEMatrixArray(int size):m_Size(size)
{
	m_Data = new float[size*16];
}

DAEMatrixArray::~DAEMatrixArray(void)
{
	delete[] m_Data;
}

void DAEMatrixArray::SetValue(unsigned int index, DAEMatrix value)
{
	int offset = index *16;
	void* dest = m_Data+offset;
	memcpy_s(dest,16*sizeof(float),value.GetValuePointer(),value.GetSizeInBytes());
}

void DAEMatrixArray::GetValue(unsigned int index, DAEMatrix& out)
{
	int offset = index*16;
	float* start = m_Data+offset;
	out.SetRow(0,start[0],start[1],start[2],start[3]);
	out.SetRow(1,start[4],start[5],start[6],start[7]);
	out.SetRow(2,start[8],start[9],start[10],start[11]);
	out.SetRow(3,start[12],start[13],start[14],start[15]);
}
